package rocketmq.controller;


import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import rocketmq.domain.RocketMqMessage;
import rocketmq.manager.RocketMqManager;

import javax.annotation.Resource;

/**
 * @author mercury
 */
@RestController
public class RocketMqController {

    @Resource
    private RocketMqManager rocketMqManager;


    @GetMapping("/sendMsg")
    public void sendMsg() {

        rocketMqManager.syncSend("topic_mercury", new RocketMqMessage("mercury"));
    }


    @GetMapping("/syncDelaySend")
    public void syncDelaySend() {

        rocketMqManager.syncDelaySend("topic_mercury",4 ,new RocketMqMessage("mercury delay"));
    }
}
